<template>
    <a-control-group>
        <a-button>刷新</a-button>
        <a-button>删除所选</a-button>
        <a-button>新增</a-button>
    </a-control-group>
    <a-collapse
        class="c-m-t-m"
        v-model:value="filterShown"
        :title="filterShown ? '收起过滤条件' : '展开过滤条件'"
    >
        <a-form :labelWidth="160" :labelAlign="'right'">
            <a-control-group :block="true" class="c-m-t-m">
                <a-label>品牌</a-label>
                <a-input-search
                    v-model:value="filter.brandId.value"
                    :searchFunc="searchBrandFunc"
                ></a-input-search>
            </a-control-group>
            <a-control-group :block="true" class="c-m-t-m">
                <a-label>品类</a-label>
                <a-input-search
                    v-model:value="filter.categoryId.value"
                    :searchFunc="searchCategoryFunc"
                ></a-input-search>
            </a-control-group>
            <a-control-group :block="true" class="c-m-t-m">
                <a-label>细分分类</a-label>
                <a-input-search
                    v-model:value="filter.subCategoryId.value"
                    :searchFunc="searchSubCategoryFunc"
                ></a-input-search>
            </a-control-group>
            <a-control-group :block="true" class="c-m-t-m">
                <a-label>名称（模糊匹配）</a-label>
                <a-input-string
                    v-model:value="filter.name.value"
                ></a-input-string>
            </a-control-group>
            <a-control-group :block="true" class="c-m-t-m">
                <a-label>是否是一线品牌商标</a-label>
                <a-input-select
                    v-model:value="filter.isPrimaryBrand.value"
                    :items="[
                        { text: '是', value: true },
                        { text: '否', value: false },
                    ]"
                ></a-input-select>
            </a-control-group>
        </a-form>
    </a-collapse>
    <a-table
        class="c-m-t-m"
        :headerList="headerList"
        :dataList="dataList"
        :selectable="true"
        v-model:value="selectedIdList"
        :maxHeight="600"
    ></a-table>
    <a-paging
        class="c-m-t-m"
        v-model:pageSize="pageSize"
        v-model:pageIndex="pageIndex"
        :totalCount="dataList.length"
    ></a-paging>
</template>

<script>
export default {
    hidden: true,
    data() {
        return {
            headerList: [
                { name: 'brandId', text: '品牌' },
                { name: 'categoryId', text: '品类' },
                { name: 'subCategoryId', text: '细分分类' },
                { name: 'name', text: '名称' },
                { name: 'isPrimaryBrand', text: '是否是一线品牌商标' },
                { name: 'oper', text: '操作' },
            ],
            dataList: [],
            selectedIdList: [],
            pageSize: 10,
            pageIndex: 1,
            filter: {
                brandId: {
                    matchType: 'equal',
                    value: null
                },
                categoryId: {
                    matchType: 'equal',
                    value: null
                },
                subCategoryId: {
                    matchType: 'equal',
                    value: null
                },
                name: {
                    matchType: 'like',
                    value: null
                },
                isPrimaryBrand: {
                    matchType: 'equal',
                    value: null
                },
            },
            filterShown: true,
            sort: {
                name: null,
                value: null
            }
        }
    },
    methods: {
        async searchBrandFunc(keyword) {
            return []
        },
        async searchCategoryFunc(keyword) {
            return []
        },
        async searchSubCategoryFunc(keyword) {
            return []
        },
        getData() {

        }
    },
}
</script>